﻿
/*----------------------------------------------------------------//
// 文件名：MoFileTemplate.cs
// 文件功能描述：实体 MoFileTemplate.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoFileTemplate
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoFileTemplate
    /// </summary>
    public partial class MoFileTemplate : ICloneable
    {
        #region 表FileTemplate的字段
        private string ftId;
        private string itemCode;
        private string xlsUrl;
        private string docUrl;
        private string rem;
        private DateTime createTime;
        #endregion

        #region 构造函数
        public MoFileTemplate()
        {
            createTime = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoFileTemplate(MoFileTemplate item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoFileTemplate(string ftId, string itemCode, string xlsUrl, string docUrl, string rem, DateTime createTime)
        {
            this.ftId = ftId;
            this.itemCode = itemCode;
            this.xlsUrl = xlsUrl;
            this.docUrl = docUrl;
            this.rem = rem;
            this.createTime = createTime;
        }
        #endregion

        #region 表FileTemplate的字段属性
        /// <summary>
        /// FT_ID
        /// </summary>
        public string FtId
        {
            get { return ftId; }
            set { ftId = value; }
        }
        /// <summary>
        /// ITEM_CODE
        /// </summary>
        public string ItemCode
        {
            get { return itemCode; }
            set { itemCode = value; }
        }
        /// <summary>
        ///EXCEL模
        /// </summary>
        public string XlsUrl
        {
            get { return xlsUrl; }
            set { xlsUrl = value; }
        }
        /// <summary>
        /// DOC_URL
        /// </summary>
        public string DocUrl
        {
            get { return docUrl; }
            set { docUrl = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        /// <summary>
        /// CREATE_TIME
        /// </summary>
        public DateTime CreateTime
        {
            get { return createTime; }
            set { createTime = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoFileTemplate CopyTo(MoFileTemplate item)
        {
            item.ftId = this.ftId;
            item.itemCode = this.itemCode;
            item.xlsUrl = this.xlsUrl;
            item.docUrl = this.docUrl;
            item.rem = this.rem;
            item.createTime = this.createTime;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoFileTemplate mo = new MoFileTemplate();
            mo.FtId = this.FtId;
            mo.ItemCode = this.ItemCode;
            mo.XlsUrl = this.XlsUrl;
            mo.DocUrl = this.DocUrl;
            mo.Rem = this.Rem;
            mo.CreateTime = this.CreateTime;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoFileTemplate NewFileTemplate = obj as MoFileTemplate;
                if (NewFileTemplate == null)
                {
                    return false;
                }
                else
                {
                    if (NewFileTemplate.FtId == this.FtId && NewFileTemplate.ItemCode == this.ItemCode && NewFileTemplate.XlsUrl == this.XlsUrl && NewFileTemplate.DocUrl == this.DocUrl && NewFileTemplate.Rem == this.Rem && NewFileTemplate.CreateTime == this.CreateTime)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "FtId={0}/ItemCode={1}/XlsUrl={2}/DocUrl={3}/Rem={4}/CreateTime={5}", ftId, itemCode, xlsUrl, docUrl, rem, createTime);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["FT_ID"] != null && row["FT_ID"] != DBNull.Value)
            {
                this.FtId = (string)row["FT_ID"];
            }
            else
            {
                this.FtId = string.Empty;
            }
            if (row["Item_Code"] != null && row["Item_Code"] != DBNull.Value)
            {
                this.ItemCode = (string)row["Item_Code"];
            }
            else
            {
                this.ItemCode = string.Empty;
            }
            if (row["Xls_Url"] != null && row["Xls_Url"] != DBNull.Value)
            {
                this.XlsUrl = (string)row["Xls_Url"];
            }
            else
            {
                this.XlsUrl = string.Empty;
            }
            if (row["Doc_Url"] != null && row["Doc_Url"] != DBNull.Value)
            {
                this.DocUrl = (string)row["Doc_Url"];
            }
            else
            {
                this.DocUrl = string.Empty;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
            if (row["Create_Time"] != null && row["Create_Time"] != DBNull.Value)
            {
                this.CreateTime = (DateTime)row["Create_Time"];
            }
            else
            {
                this.CreateTime = DateTime.MinValue;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["FT_ID"] = this.FtId;
            row["Item_Code"] = this.ItemCode;
            row["Xls_Url"] = this.XlsUrl;
            row["Doc_Url"] = this.DocUrl;
            row["Rem"] = this.Rem;
            row["Create_Time"] = this.CreateTime;
        }
        #endregion
    }
}
#endregion
